package cn.iocoder.yudao.module.promotion.groupon.controller.admin;

import cn.iocoder.yudao.framework.business.basic.controller.PageController;
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.module.promotion.groupon.pojo.dto.AdminGrouponPackageFavoriteQueryDTO;
import cn.iocoder.yudao.module.promotion.groupon.pojo.vo.AdminGrouponPackageFavoriteVO;
import cn.iocoder.yudao.module.promotion.groupon.service.admin.AdminGrouponPackageFavoriteService;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.annotation.Resource;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;

@Tag(name = "管理后台 - 团购套餐收藏")
@RestController
@RequestMapping("/promotion/groupon-package/favorite")
@Validated
public class GrouponPackageFavoriteController implements PageController<AdminGrouponPackageFavoriteVO, AdminGrouponPackageFavoriteQueryDTO> {

    @Resource
    private AdminGrouponPackageFavoriteService adminGrouponPackageFavoriteService;

    @PreAuthorize("@ss.hasPermission('groupon:package-favorite:query')")
    @Override
    public CommonResult<PageResult<AdminGrouponPackageFavoriteVO>> getPage(Integer pageNo, Integer pageSize, AdminGrouponPackageFavoriteQueryDTO param) {
        PageResult<AdminGrouponPackageFavoriteVO> pageResult = adminGrouponPackageFavoriteService.getPage(pageNo, pageSize, param);
        return success(pageResult);
    }

}
